﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FactoryMethod
{
  public  class FactoryMethod
    {
        public Button CreateButton(string flag)
        {
            Button button = null;
            switch (flag)
            {
                case "win":
                    button = new WinButton();
                    break;
                case "mac":
                    button = new MacButton();
                    break;
            }
            return button;
        }
    }
}
